package com.example.yiwei.crm.view.frament.menuFragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.example.yiwei.crm.R;
import com.example.yiwei.crm.data.QXData;
import com.example.yiwei.crm.view.activity.coordinationActivity.ManYiDuActivity;
import com.example.yiwei.crm.view.activity.coordinationActivity.SimpleCoordinationActivity;
import com.example.yiwei.crm.view.activity.jtCustomer.CustomerJZSeacherActivity;
import com.example.yiwei.crm.view.activity.jtCustomer.CustomerYYJzSeacherActivity;
import com.example.yiwei.crm.view.activity.jtCustomer.SimpleJtCustomerActivity;


/**
 * Created by DHN on 2016/12/2.
 */
//CRM界面
public class crm_fragment extends Fragment {
    LinearLayout linearLayout_customeSource,linearLayout_customerMnager,linearLayout_healthManage,
            linearlayout_user,linearLayout_customer,linearlayout_contact,linearLayout_clue,
            linearLayout_clue_group,linearLayout_receive_customer,linearLayout_health_education,
            linearLayout_activity,linearLayout_coordination,linearLayout_customer_manager,linearLayout_customet_customer,linearLayout_customet_yuyuejl,
            linearLayout_customet_yuyuejz,linearLayout_customet_kehuchi,linearLayout_customet_gtgl,linearLayout_customet_jzss,linearLayout_customet_yyjz,
            linearLayout_customet_qxgl,linearLayout_customet_hfkh,linearLayout_customet_hfgl;
    LinearLayout linearLayout_bb,linearLayout_bb_qd,linearLayout_bb_bz,linearLayout_bb_yy,linearLayout_bb_yyqd,linearLayout_bb_yybz,linearLayout_bb_sc;
    ImageView btn_customet,btn_bb;
    ImageView btn1,btn2,btn3,btn4,btn5,btn6,btn7,btn8;
    LinearLayout linearLayout1,linearLayout2,linearLayout3,linearLayout4,linearLayout5,linearLayout6,linearLayout7,linearLayout8;
    LinearLayout linearLayout_z_1,linearLayout_z_2,linearLayout_z_3,linearLayout_z_4,linearLayout_z_5,linearLayout_z_6,linearLayout_z_7,linearLayout_z_8,linearLayout_z_9,
            linearLayout_z_10,linearLayout_z_11,linearLayout_z_12,linearLayout_z_13,linearLayout_z_14,linearLayout_z_15,linearLayout_z_16,linearLayout_z_17,linearLayout_z_18,
            linearLayout_z_19,linearLayout_z_20,linearLayout_z_21,linearLayout_z_22,linearLayout_z_23,linearLayout_z_24,linearLayout_z_25,linearLayout_z_26,
            linearLayout_z_27,linearLayout_z_28,linearLayout_z_29,linearLayout_z_30,linearLayout_z_31,linearLayout_z_32,linearLayout_z_33,linearLayout_z_34,
            linearLayout_z_35,linearLayout_z_36,linearLayout_z_37,linearLayout_z_38,linearLayout_z_39,linearLayout_z_40,linearLayout_z_41,linearLayout_z_42,
            linearLayout_z_43,linearLayout_z_44,linearLayout_z_45,linearLayout_z_46,linearLayout_z_47;
    public View onCreateView(final LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootview=inflater.inflate(R.layout.frament_third,container,false);
//        linearLayout_healthManage= (LinearLayout) rootview.findViewById(R.id.fra_crm_healthManage);
//        linearlayout_user= (LinearLayout) rootview.findViewById(R.id.);
        linearLayout_customer= (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_customer);
        linearLayout_customer.setVisibility(View.GONE);
        linearLayout_customer_manager= (LinearLayout) rootview.findViewById(R.id.crm_linear_customer_manager);
        linearLayout_customer_manager.setVisibility(View.GONE);
//        linearLayout_customerMnager= (LinearLayout) rootview.findViewById(R.id.frm_crm_cutomerMnager);
//        linearlayout_contact= (LinearLayout) rootview.findViewById(R.id.fragment_crm_linear_contact);
        linearLayout_clue_group= (LinearLayout) rootview.findViewById(R.id.crm_linear_clue_group);
        linearLayout_clue_group.setVisibility(View.GONE);
        linearLayout_receive_customer= (LinearLayout) rootview.findViewById(R.id.crm_linear_receive_customer);
        linearLayout_receive_customer.setVisibility(View.GONE);
        linearLayout_health_education= (LinearLayout) rootview.findViewById(R.id.crm_linear_health_education);
        linearLayout_health_education.setVisibility(View.GONE);
        linearLayout_activity= (LinearLayout) rootview.findViewById(R.id.crm_linear_task_activity);
        linearLayout_activity.setVisibility(View.GONE);
        linearLayout_coordination = (LinearLayout) rootview.findViewById(R.id.crm_linear_coordination);
        linearLayout_coordination.setVisibility(View.GONE);
        //父菜单初始化
        btn1 = (ImageView) rootview.findViewById(R.id.frm_btn_linear_1);
        btn2 = (ImageView) rootview.findViewById(R.id.frm_btn_linear_2);
        btn3 = (ImageView) rootview.findViewById(R.id.frm_btn_linear_3);
        btn4 = (ImageView) rootview.findViewById(R.id.frm_btn_linear_4);
        btn5 = (ImageView) rootview.findViewById(R.id.frm_btn_linear_5);
        btn6 = (ImageView) rootview.findViewById(R.id.frm_btn_linear_6);
        btn7 = (ImageView) rootview.findViewById(R.id.frm_btn_linear_7);
        btn8 = (ImageView) rootview.findViewById(R.id.frm_btn_linear_8);
        linearLayout1 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_1);
        linearLayout1.setVisibility(View.GONE);
        linearLayout2 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_2);
        linearLayout2.setVisibility(View.GONE);
        linearLayout3 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_3);
        linearLayout3.setVisibility(View.GONE);
        linearLayout4 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_4);
        linearLayout4.setVisibility(View.GONE);
        linearLayout5 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_5);
        linearLayout5.setVisibility(View.GONE);
        linearLayout6 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_6);
        linearLayout6.setVisibility(View.GONE);
        linearLayout7 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_7);
        linearLayout7.setVisibility(View.GONE);
        linearLayout8 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_8);
        linearLayout8.setVisibility(View.GONE);
        //子菜单初始化
        linearLayout_z_1 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_1);
        linearLayout_z_1.setVisibility(View.GONE);
        linearLayout_z_2 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_2);
        linearLayout_z_2.setVisibility(View.GONE);
        linearLayout_z_3 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_3);
        linearLayout_z_3.setVisibility(View.GONE);
        linearLayout_z_4 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_4);
        linearLayout_z_4.setVisibility(View.GONE);
        linearLayout_z_5 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_5);
        linearLayout_z_5.setVisibility(View.GONE);
        linearLayout_z_6 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_6);
        linearLayout_z_6.setVisibility(View.GONE);
        linearLayout_z_7 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_7);
        linearLayout_z_7.setVisibility(View.GONE);
        linearLayout_z_8 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_8);
        linearLayout_z_8.setVisibility(View.GONE);
        linearLayout_z_9 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_9);
        linearLayout_z_9.setVisibility(View.GONE);
        linearLayout_z_10 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_10);
        linearLayout_z_10.setVisibility(View.GONE);
        linearLayout_z_11 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_11);
        linearLayout_z_11.setVisibility(View.GONE);
        linearLayout_z_12 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_12);
        linearLayout_z_12.setVisibility(View.GONE);
        linearLayout_z_13 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_13);
        linearLayout_z_13.setVisibility(View.GONE);
        linearLayout_z_14 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_14);
        linearLayout_z_14.setVisibility(View.GONE);
        linearLayout_z_15 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_15);
        linearLayout_z_15.setVisibility(View.GONE);
        linearLayout_z_16 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_16);
        linearLayout_z_16.setVisibility(View.GONE);
        linearLayout_z_17 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_17);
        linearLayout_z_17.setVisibility(View.GONE);
        linearLayout_z_18 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_18);
        linearLayout_z_18.setVisibility(View.GONE);
        linearLayout_z_19 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_19);
        linearLayout_z_19.setVisibility(View.GONE);
        linearLayout_z_20 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_20);
        linearLayout_z_20.setVisibility(View.GONE);
        linearLayout_z_21 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_21);
        linearLayout_z_21.setVisibility(View.GONE);
        linearLayout_z_22 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_22);
        linearLayout_z_22.setVisibility(View.GONE);
        linearLayout_z_23 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_23);
        linearLayout_z_23.setVisibility(View.GONE);
        linearLayout_z_24 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_24);
        linearLayout_z_24.setVisibility(View.GONE);
        linearLayout_z_25 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_25);
        linearLayout_z_25.setVisibility(View.GONE);
        linearLayout_z_26 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_26);
        linearLayout_z_26.setVisibility(View.GONE);
        linearLayout_z_27 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_27);
        linearLayout_z_27.setVisibility(View.GONE);
        linearLayout_z_28 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_28);
        linearLayout_z_28.setVisibility(View.GONE);
        linearLayout_z_29 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_29);
        linearLayout_z_29.setVisibility(View.GONE);
        linearLayout_z_30 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_30);
        linearLayout_z_30.setVisibility(View.GONE);
        linearLayout_z_31 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_31);
        linearLayout_z_31.setVisibility(View.GONE);
        linearLayout_z_32 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_32);
        linearLayout_z_32.setVisibility(View.GONE);
        linearLayout_z_33 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_33);
        linearLayout_z_33.setVisibility(View.GONE);
        linearLayout_z_34 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_34);
        linearLayout_z_34.setVisibility(View.GONE);
        linearLayout_z_35 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_35);
        linearLayout_z_35.setVisibility(View.GONE);
        linearLayout_z_36 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_36);
        linearLayout_z_36.setVisibility(View.GONE);
        linearLayout_z_37 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_37);
        linearLayout_z_37.setVisibility(View.GONE);
        linearLayout_z_38 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_38);
        linearLayout_z_38.setVisibility(View.GONE);
        linearLayout_z_39 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_39);
        linearLayout_z_39.setVisibility(View.GONE);
        linearLayout_z_40 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_40);
        linearLayout_z_40.setVisibility(View.GONE);
        linearLayout_z_41 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_41);
        linearLayout_z_41.setVisibility(View.GONE);
        linearLayout_z_42 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_42);
        linearLayout_z_42.setVisibility(View.GONE);
        linearLayout_z_43 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_43);
        linearLayout_z_43.setVisibility(View.GONE);
        linearLayout_z_44 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_44);
        linearLayout_z_44.setVisibility(View.GONE);
        linearLayout_z_45 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_45);
        linearLayout_z_45.setVisibility(View.GONE);
        linearLayout_z_46 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_46);
        linearLayout_z_46.setVisibility(View.GONE);
        linearLayout_z_47 = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_z_47);
        linearLayout_z_47.setVisibility(View.GONE);


        //客户管理二级菜单初始化
        btn_customet = (ImageView) rootview.findViewById(R.id.frm_btn_linear_customer);
        linearLayout_customet_customer = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_customer_customer);
        linearLayout_customet_yuyuejl = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_customer_yuyue);
        linearLayout_customet_yuyuejz = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_customer_yuyuejz);
        linearLayout_customet_kehuchi = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_customer_kehuchi);
        linearLayout_customet_gtgl = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_customer_goutong);
        linearLayout_customet_jzss = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_customer_jzss);
        linearLayout_customet_yyjz = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_customer_yuyuejzss);
        linearLayout_customet_qxgl = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_customer_qxgl);
        linearLayout_customet_hfkh = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_customer_hfkh);
        linearLayout_customet_hfgl = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_customer_huifang);
        linearLayout_customet_customer.setVisibility(View.GONE);
        linearLayout_customet_yuyuejl.setVisibility(View.GONE);
        linearLayout_customet_yuyuejz.setVisibility(View.GONE);
        linearLayout_customet_kehuchi.setVisibility(View.GONE);
        linearLayout_customet_gtgl.setVisibility(View.GONE);
        linearLayout_customet_jzss.setVisibility(View.GONE);
        linearLayout_customet_yyjz.setVisibility(View.GONE);
        linearLayout_customet_qxgl.setVisibility(View.GONE);
        linearLayout_customet_hfkh.setVisibility(View.GONE);
        linearLayout_customet_hfgl.setVisibility(View.GONE);

        //报表管理二级列表
        btn_bb = (ImageView) rootview.findViewById(R.id.frm_btn_linear_bb);
        linearLayout_bb = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_bbgl);
        linearLayout_bb.setVisibility(View.GONE);
        linearLayout_bb_qd = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_bb_qd);
        linearLayout_bb_bz = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_bb_bz);
        linearLayout_bb_yy = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_bb_yy);
        linearLayout_bb_yyqd = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_bb_yyqd);
        linearLayout_bb_yybz = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_bb_yybz);
        linearLayout_bb_sc = (LinearLayout) rootview.findViewById(R.id.frm_crm_linear_bb_sc);
        linearLayout_bb_qd.setVisibility(View.GONE);
        linearLayout_bb_bz.setVisibility(View.GONE);
        linearLayout_bb_yy.setVisibility(View.GONE);
        linearLayout_bb_yyqd.setVisibility(View.GONE);
        linearLayout_bb_yybz.setVisibility(View.GONE);
        linearLayout_bb_sc.setVisibility(View.GONE);
//        //跳转到联系人信息界面
//        linearlayout_contact.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                Intent intent=new Intent(getActivity(), ContactSimpleMessageActivity.class);
//                startActivity(intent);
//            }
//        });
//        //跳转到客户信息界面
        linearLayout_customet_customer.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(getActivity(), SimpleJtCustomerActivity.class);
                startActivity(intent);
            }
        });
        //跳转预约记录界面
        linearLayout_customet_yuyuejl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //跳转回访客户界面
        linearLayout_customet_hfkh.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //跳转预约就诊界面
        linearLayout_customet_yuyuejz.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //跳转客户池界面
        linearLayout_customet_kehuchi.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //跳转沟通管理界面
        linearLayout_customet_gtgl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //跳转回访管理界面
        linearLayout_customet_hfgl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //跳转精准搜索界面
        linearLayout_customet_jzss.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), CustomerJZSeacherActivity.class);
                startActivity(intent);
            }
        });
        //跳转预约记录精准搜索界面
        linearLayout_customet_yyjz.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), CustomerYYJzSeacherActivity.class);
                startActivity(intent);
            }
        });
        //跳转取消关联界面
        linearLayout_customet_qxgl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //客户管理列表

        linearLayout_customer.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (linearLayout_customet_customer.getVisibility()==View.GONE){
                    btn_customet.setImageResource(R.drawable.xiangshang);
                    linearLayout_customet_customer.setVisibility(View.VISIBLE);
                    linearLayout_customet_yuyuejl.setVisibility(View.VISIBLE);
                    linearLayout_customet_yuyuejz.setVisibility(View.VISIBLE);
                    linearLayout_customet_kehuchi.setVisibility(View.VISIBLE);
                    linearLayout_customet_gtgl.setVisibility(View.VISIBLE);
                    linearLayout_customet_jzss.setVisibility(View.VISIBLE);
                    linearLayout_customet_yyjz.setVisibility(View.VISIBLE);
                    linearLayout_customet_qxgl.setVisibility(View.VISIBLE);
                    linearLayout_customet_hfkh.setVisibility(View.VISIBLE);
                    linearLayout_customet_hfgl.setVisibility(View.VISIBLE);
                }else {
                    btn_customet.setImageResource(R.drawable.xiangxia);
                    linearLayout_customet_customer.setVisibility(View.GONE);
                    linearLayout_customet_yuyuejl.setVisibility(View.GONE);
                    linearLayout_customet_yuyuejz.setVisibility(View.GONE);
                    linearLayout_customet_kehuchi.setVisibility(View.GONE);
                    linearLayout_customet_gtgl.setVisibility(View.GONE);
                    linearLayout_customet_jzss.setVisibility(View.GONE);
                    linearLayout_customet_yyjz.setVisibility(View.GONE);
                    linearLayout_customet_qxgl.setVisibility(View.GONE);
                    linearLayout_customet_hfkh.setVisibility(View.GONE);
                    linearLayout_customet_hfgl.setVisibility(View.GONE);
                }

            }
        });

        //跳转渠道报表
        linearLayout_bb_qd.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //跳转病种报表
        linearLayout_bb_bz.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //跳转预约列表报表
        linearLayout_bb_yy.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });

        //跳转医院与渠道分类报表
        linearLayout_bb_yyqd.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //跳转医院与病种分类报表
        linearLayout_bb_yybz.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //跳转删除预约报表
        linearLayout_bb_sc.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //报表管理列表
        linearLayout_bb.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (linearLayout_bb_sc.getVisibility()==View.GONE){
                    btn_bb.setImageResource(R.drawable.xiangshang);
                    linearLayout_bb_qd.setVisibility(View.VISIBLE);
                    linearLayout_bb_bz.setVisibility(View.VISIBLE);
                    linearLayout_bb_yyqd.setVisibility(View.VISIBLE);
                    linearLayout_bb_yybz.setVisibility(View.VISIBLE);
                    linearLayout_bb_yy.setVisibility(View.VISIBLE);
                    linearLayout_bb_sc.setVisibility(View.VISIBLE);
                }else {
                    btn_bb.setImageResource(R.drawable.xiangxia);
                    linearLayout_bb_qd.setVisibility(View.GONE);
                    linearLayout_bb_bz.setVisibility(View.GONE);
                    linearLayout_bb_yy.setVisibility(View.GONE);
                    linearLayout_bb_yyqd.setVisibility(View.GONE);
                    linearLayout_bb_yybz.setVisibility(View.GONE);
                    linearLayout_bb_sc.setVisibility(View.GONE);
                }
            }
        });
        //网格管理
        linearLayout1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (linearLayout_z_1.getVisibility()==View.GONE){
                    btn1.setImageResource(R.drawable.xiangshang);
                    linearLayout_z_1.setVisibility(View.VISIBLE);
                }else {
                    btn1.setImageResource(R.drawable.xiangxia);
                    linearLayout_z_1.setVisibility(View.GONE);
                }
            }
        });
        //系统管理
        linearLayout2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (linearLayout_z_2.getVisibility()==View.GONE){
                    btn2.setImageResource(R.drawable.xiangshang);
                    linearLayout_z_2.setVisibility(View.VISIBLE);
                    linearLayout_z_3.setVisibility(View.VISIBLE);
                    linearLayout_z_4.setVisibility(View.VISIBLE);
                    linearLayout_z_5.setVisibility(View.VISIBLE);
                    linearLayout_z_6.setVisibility(View.VISIBLE);
                    linearLayout_z_7.setVisibility(View.VISIBLE);
                    linearLayout_z_8.setVisibility(View.VISIBLE);
                    linearLayout_z_9.setVisibility(View.VISIBLE);
                }else {
                    btn2.setImageResource(R.drawable.xiangxia);
                    linearLayout_z_2.setVisibility(View.GONE);
                    linearLayout_z_3.setVisibility(View.GONE);
                    linearLayout_z_4.setVisibility(View.GONE);
                    linearLayout_z_5.setVisibility(View.GONE);
                    linearLayout_z_6.setVisibility(View.GONE);
                    linearLayout_z_7.setVisibility(View.GONE);
                    linearLayout_z_8.setVisibility(View.GONE);
                    linearLayout_z_9.setVisibility(View.GONE);
                }
            }
        });
        //基础管理
        linearLayout3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (linearLayout_z_10.getVisibility()==View.GONE){
                    btn3.setImageResource(R.drawable.xiangshang);
                    linearLayout_z_10.setVisibility(View.VISIBLE);
                    linearLayout_z_11.setVisibility(View.VISIBLE);
                    linearLayout_z_12.setVisibility(View.VISIBLE);
                    linearLayout_z_13.setVisibility(View.VISIBLE);
                    linearLayout_z_14.setVisibility(View.VISIBLE);
                    linearLayout_z_15.setVisibility(View.VISIBLE);
                    linearLayout_z_16.setVisibility(View.VISIBLE);
                    linearLayout_z_17.setVisibility(View.VISIBLE);
                    linearLayout_z_18.setVisibility(View.VISIBLE);
                    linearLayout_z_19.setVisibility(View.VISIBLE);
                    linearLayout_z_20.setVisibility(View.VISIBLE);
                    linearLayout_z_21.setVisibility(View.VISIBLE);
                    linearLayout_z_22.setVisibility(View.VISIBLE);
                    linearLayout_z_23.setVisibility(View.VISIBLE);
                    linearLayout_z_24.setVisibility(View.VISIBLE);
                    linearLayout_z_25.setVisibility(View.VISIBLE);
                    linearLayout_z_26.setVisibility(View.VISIBLE);
                }else {
                    btn3.setImageResource(R.drawable.xiangxia);
                    linearLayout_z_10.setVisibility(View.GONE);
                    linearLayout_z_11.setVisibility(View.GONE);
                    linearLayout_z_12.setVisibility(View.GONE);
                    linearLayout_z_13.setVisibility(View.GONE);
                    linearLayout_z_14.setVisibility(View.GONE);
                    linearLayout_z_15.setVisibility(View.GONE);
                    linearLayout_z_16.setVisibility(View.GONE);
                    linearLayout_z_17.setVisibility(View.GONE);
                    linearLayout_z_18.setVisibility(View.GONE);
                    linearLayout_z_19.setVisibility(View.GONE);
                    linearLayout_z_20.setVisibility(View.GONE);
                    linearLayout_z_21.setVisibility(View.GONE);
                    linearLayout_z_22.setVisibility(View.GONE);
                    linearLayout_z_23.setVisibility(View.GONE);
                    linearLayout_z_24.setVisibility(View.GONE);
                    linearLayout_z_25.setVisibility(View.GONE);
                    linearLayout_z_26.setVisibility(View.GONE);
                }
            }
        });
        //线索管理
        linearLayout8.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (linearLayout_z_27.getVisibility()==View.GONE){
                    btn8.setImageResource(R.drawable.xiangshang);
                    linearLayout_z_27.setVisibility(View.VISIBLE);
                    linearLayout_z_28.setVisibility(View.VISIBLE);
                }else {
                    btn8.setImageResource(R.drawable.xiangxia);
                    linearLayout_z_27.setVisibility(View.GONE);
                    linearLayout_z_28.setVisibility(View.GONE);
                }
            }
        });
        //健教管理
        linearLayout4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (linearLayout_z_29.getVisibility()==View.GONE){
                    btn4.setImageResource(R.drawable.xiangshang);
                    linearLayout_z_29.setVisibility(View.VISIBLE);
                    linearLayout_z_30.setVisibility(View.VISIBLE);
                }else {
                    btn4.setImageResource(R.drawable.xiangxia);
                    linearLayout_z_29.setVisibility(View.GONE);
                    linearLayout_z_30.setVisibility(View.GONE);
                }
            }
        });
        //导诊管理
        linearLayout5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (linearLayout_z_31.getVisibility()==View.GONE){
                    btn5.setImageResource(R.drawable.xiangshang);
                    linearLayout_z_31.setVisibility(View.VISIBLE);
                    linearLayout_z_32.setVisibility(View.VISIBLE);
                }else {
                    btn5.setImageResource(R.drawable.xiangxia);
                    linearLayout_z_31.setVisibility(View.GONE);
                    linearLayout_z_32.setVisibility(View.GONE);
                }
            }
        });
        //回访管理
        linearLayout6.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (linearLayout_z_33.getVisibility()==View.GONE){
                    btn6.setImageResource(R.drawable.xiangshang);
                    linearLayout_z_33.setVisibility(View.VISIBLE);
                    linearLayout_z_34.setVisibility(View.VISIBLE);
                    linearLayout_z_35.setVisibility(View.VISIBLE);
                    linearLayout_z_36.setVisibility(View.VISIBLE);
                    linearLayout_z_37.setVisibility(View.VISIBLE);
                    linearLayout_z_38.setVisibility(View.VISIBLE);
                    linearLayout_z_39.setVisibility(View.VISIBLE);
                    linearLayout_z_40.setVisibility(View.VISIBLE);
                }else {
                    btn6.setImageResource(R.drawable.xiangxia);
                    linearLayout_z_33.setVisibility(View.GONE);
                    linearLayout_z_34.setVisibility(View.GONE);
                    linearLayout_z_35.setVisibility(View.GONE);
                    linearLayout_z_36.setVisibility(View.GONE);
                    linearLayout_z_37.setVisibility(View.GONE);
                    linearLayout_z_38.setVisibility(View.GONE);
                    linearLayout_z_39.setVisibility(View.GONE);
                    linearLayout_z_40.setVisibility(View.GONE);
                }
            }
        });
        //回访管理
        linearLayout7.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (linearLayout_z_41.getVisibility()==View.GONE){
                    btn7.setImageResource(R.drawable.xiangshang);
                    linearLayout_z_41.setVisibility(View.VISIBLE);
                    linearLayout_z_42.setVisibility(View.VISIBLE);
                    linearLayout_z_43.setVisibility(View.VISIBLE);
                    linearLayout_z_44.setVisibility(View.VISIBLE);
                    linearLayout_z_45.setVisibility(View.VISIBLE);
                    linearLayout_z_46.setVisibility(View.VISIBLE);
                    linearLayout_z_47.setVisibility(View.VISIBLE);
                }else {
                    btn7.setImageResource(R.drawable.xiangxia);
                    linearLayout_z_41.setVisibility(View.GONE);
                    linearLayout_z_42.setVisibility(View.GONE);
                    linearLayout_z_43.setVisibility(View.GONE);
                    linearLayout_z_44.setVisibility(View.GONE);
                    linearLayout_z_45.setVisibility(View.GONE);
                    linearLayout_z_46.setVisibility(View.GONE);
                    linearLayout_z_47.setVisibility(View.GONE);
                }
            }
        });
//        //跳转客户池信息界面
//        linearLayout_customerMnager.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                Intent intent=new Intent(getActivity(), CustomerSimpleMessageActivity.class);
//                intent.putExtra("kehuchiTag","kehuchi");
//                startActivity(intent);
//            }
//        });
//        //跳转到线索界面
//        linearLayout_clue.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                Intent intent=new Intent(getActivity(), ClueSimpleMessageActivity.class);
//                startActivity(intent);
//            }
//        });
//        //跳转到线索池界面
//        linearLayout_clue_group.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                Intent intent=new Intent(getActivity(),ClueSimpleMessageActivity.class);
//                intent.putExtra("xiansuochiTag","xiansuochi");
//                startActivity(intent);
//            }
//        });
//        //跳转到领取客户界面
//        linearLayout_receive_customer.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                Intent intent=new Intent(getActivity(),SimpleReceiveCustomerActivity.class);
//                startActivity(intent);
//            }
//        });
//        //跳转到对接人界面
//        linearLayout_health_education.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                Intent intent=new Intent(getActivity(),simpleHealthEducationActivity.class);
//                startActivity(intent);
//            }
//        });
//        //跳转到任务活动界面
//        linearLayout_activity.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                Intent intent=new Intent(getActivity(), TeamSimpleMessageActivity.class);
//                startActivity(intent);
//            }
//        });
        linearLayout_coordination.setVisibility(View.GONE);
        for (int i = 0; i< QXData.list.size(); i++){
            if ("协作人".equals(QXData.list.get(i).getName())){
                linearLayout_coordination.setVisibility(View.VISIBLE);
                //跳转协作界面
                linearLayout_coordination.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Intent intent =new Intent(getActivity(), SimpleCoordinationActivity.class);
                        startActivity(intent);
                    }
                });

            }
        }
        linearLayout_customer_manager.setVisibility(View.GONE);
        for (int i = 0;i< QXData.list.size();i++){
            if ("接待预约".equals(QXData.list.get(i).getName())){
                //跳转到客户管理页面
                linearLayout_customer_manager.setVisibility(View.VISIBLE);
                linearLayout_customer_manager.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        Intent intent=new Intent(getActivity(), ManYiDuActivity.class);
                        startActivity(intent);
                    }
                });

            }
        }
        for (int i = 0; i< QXData.list.size(); i++){
            if ("客户".equals(QXData.list.get(i).getName())){
                linearLayout_customer.setVisibility(View.VISIBLE);
            }
            if ("报表管理".equals(QXData.list.get(i).getName())){
                linearLayout_bb.setVisibility(View.VISIBLE);
            }
            if ("网格管理".equals(QXData.list.get(i).getName())){
                linearLayout1.setVisibility(View.VISIBLE);
                linearLayout2.setVisibility(View.VISIBLE);
                linearLayout3.setVisibility(View.VISIBLE);
                linearLayout4.setVisibility(View.VISIBLE);
                linearLayout5.setVisibility(View.VISIBLE);
                linearLayout6.setVisibility(View.VISIBLE);
                linearLayout7.setVisibility(View.VISIBLE);
                linearLayout8.setVisibility(View.VISIBLE);
            }
        }
        return rootview;
    }
}
